//
//  FPBankCardModel.h
//  FinanceProject
//
//  Created by 陈显摆 on 2025/1/23.
//

#import <JSONModel/JSONModel.h>

NS_ASSUME_NONNULL_BEGIN



@protocol BankCardErrorMessage <NSObject>
@end
@interface BankCardErrorMessage : JSONModel

@property (nonatomic , strong) NSString *errorCodes;
@property (nonatomic , strong) NSString *name;

@end

@interface FPBankCardModel : JSONModel

//@property (nonatomic , strong) NSString *affiliation;
//@property (nonatomic , strong) NSString *cardNumber;
//@property (nonatomic , strong) NSString *cardholderName;
//@property (nonatomic , strong) NSString *ID;
//@property (nonatomic , strong) NSString *phone;
//
//// 阿里返回的卡信息
//@property (nonatomic , strong) NSString *cardType; //   "DC":"储蓄卡",   "CC":"信用卡", "SCC":"准贷记卡",   "PC":"预付费卡"
@property (nonatomic , strong) NSString *bank;
//@property (nonatomic , strong) NSString *key;
//@property (nonatomic , strong) NSString *validated;
//@property (nonatomic , strong) NSString *stat;
//
//@property (nonatomic , strong) NSArray <BankCardErrorMessage> *messages;
//@property (nonatomic , strong) NSString *logo;
@property (nonatomic , assign) BOOL isSelect;

@property (nonatomic , strong) NSString *bankCard;
@property (nonatomic , strong) NSString *bankDictionaryId;
@property (nonatomic , strong) NSString *bankName;
@property (nonatomic , strong) NSString *cardType; //   "DC":"储蓄卡",   "CC":"信用卡", "SCC":"准贷记卡",   "PC":"预付费卡"
@property (nonatomic , strong) NSString *colorCode;

@property (nonatomic , strong) NSString *country;
@property (nonatomic , strong) NSString *createdTime;
@property (nonatomic , strong) NSString *currency;
@property (nonatomic , strong) NSString *cvv;
@property (nonatomic , strong) NSString *delFlag;

@property (nonatomic , strong) NSString *expirationDate;
@property (nonatomic , strong) NSString *ID;
@property (nonatomic , strong) NSString *idCard;
@property (nonatomic , strong) NSString *imagePath;
@property (nonatomic , strong) NSString *isDefault;

@property (nonatomic , strong) NSString *lastFourDigits;
@property (nonatomic , strong) NSString *name;
@property (nonatomic , strong) NSString *openBank;
@property (nonatomic , strong) NSString *phone;
@property (nonatomic , strong) NSString *status;

@property (nonatomic , strong) NSString *updatedTime;
@property (nonatomic , strong) NSString *userId;






+ (NSDictionary *)readJSONFileWithName:(NSString *)fileName;

+ (void)saveBankCardWithParam:(NSDictionary *)param success:(void (^)(NSInteger code , NSString *message))success failure:(void (^)(NSError *error))failure;

+ (void)getCardListSuccess:(void (^)(NSInteger code , NSString *message , NSArray *list))success failure:(void (^)(NSError *error))failure;

// 获取所属银行
+ (void)getBankInfoWithCardNumber:(NSString *)cardNo success:(void (^)(FPBankCardModel *model))success failure:(void (^)(NSError *error))failure;


#pragma mark - 获取还款状态
+ (void)getOrderStatusWithID:(NSString *)ID success:(void (^)(NSInteger code , NSString *message))success failure:(void (^)(NSError *error))failure;

+ (void)deleteBankCardWithID:(NSString *)cardID success:(void (^)(NSInteger code , NSString *message))success failure:(void (^)(NSError *error))failure;



@end

NS_ASSUME_NONNULL_END
